package com.flowable.listener;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.flowable.mapper.LeaveMapper;
import com.flowable.pojo.Leave;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * 长沙先飞信息科技有限公司<br>
 * Created with IntelliJ IDEA.<br>
 * Date:2024/7/8<br>
 * Time:13:18<br>
 * 功能描述：<br>
 *
 * @author huang hou chun
 * @since JDK 1.8 <br>
 * Copyright (c) 2023 www.csxfrj.com System Incorporated All Rights Reserved.
 */
@Component
@Transactional
public class LeaveEndListener implements ExecutionListener {

    @Resource
    private RuntimeService runtimeService;
    @Resource
    private HistoryService historyService;

    @Override
    public void notify(DelegateExecution execution) {
        String processInstanceId = execution.getProcessInstanceId();
        System.out.println("流程结束了：" + processInstanceId);
        // historyService.deleteHistoricProcessInstance(processInstanceId);
    }
}
